#ifndef _ubvm_polygon_H_
#define	_ubvm_polygon_H_

#include "DIVA_VM.h"

class ubvm_quadrilateral: public DIVA_VM
{
protected:
	Ogre::ManualObject* _manual ;
	Ogre::MeshPtr _meshptr ;
	float* _vm_x1;
	float* _vm_y1;
	float* _vm_x2;
	float* _vm_y2;
	float* _vm_x3;
	float* _vm_y3;
	float* _vm_x4;
	float* _vm_y4;
	float* _vm_z;
	float* _vm_depth;
	static int _UNIQUE_INT ;
	string _mesh_name ;
	string _manual_name ;
public:
	ubvm_quadrilateral(xParameterPack xpp);
	~ubvm_quadrilateral();

	std::string getVMType() { return std::string("primitive"); }

	// the overriden method of DIVA_VM
	void load_3Dresources();
	void reg_event_entity();
	void set_default_values();

	void init_private_attrs_started(); // no more private attributes
	void init_private_attrs_ended(); // special process for attr vm_radius
	void init_clickmsg();
	void VMValueUpdated();

	// the overridden method of OgreVM
	void setBodyScale(Ogre::Vector3);
	Ogre::Vector3 getOriginalBodySize();
	Ogre::Vector3 getActualSize();
	bool isBodyScaleWrtSceneNode();
	Ogre::Vector3 getBodyScale();
};

#endif	//#ifndef _ubvm_polygon_H_